import sys
import os

# 添加项目根目录到 Python 路径
sys.path.append(os.path.abspath("../"))

from include import para    
from include import dataBase
from include import dealDate
from include import dealCode
from include import dealHistory

if __name__ == '__main__':
    connect = dataBase.dataBaseConnect("../../dataBaseConfig.json")
    #print(connect.show("date"))
    #print(connect.create("codetest",''' CREATE TABLE IF NOT EXISTS codetest (
    #    code VARCHAR(10) PRIMARY KEY,
    #    name VARCHAR(100) NOT NULL,
    #    market VARCHAR(10) NOT NULL
    #    ); '''))
    #print("insert")

    #print(connect.insert("codetest","insert into codetest values ('111','abc','222')"))
    #dealDateTest = dealDate.dealDate(connect)   
    #dealDateTest.saveDate()
    #print(dealDateTest.getAllDate())

    #dealCodeTest = dealCode.dealCode(connect)
    #dealCodeTest.save()
    #print(dealCodeTest.getAllCode())
    #print("********************************************************************************************")
    #print(dealCodeTest.getMarketCode("科创板"))
    #print("********************************************************************************************")
    #print(dealCodeTest.getName("600001"))

    dealHistoryTest = dealHistory.dealHistory(connect)
    #ealHistoryTest.saveAll()
    
    dealHistoryTest.getTopDay()


    connect.commit()





